import { useImmer  } from "use-immer";
import QuesaItem, { QuestionType } from './components/QuesaItem';
import { Input } from "antd";
import { useTitle } from 'ahooks';

const list = [
  {
    _id: '1',
    title: '问卷1',
    answerCount: 2,
    isPublished: false,
    createTime: '2025-04-27',
    isCollect: true
  },
]
function PageEntry() {
  useTitle('问卷列表 - 标星问卷');
  const [tableList, setTableList] = useImmer<QuestionType[]>(list)

  return (
    <div className="p-10px">
      <div className="flex items-center justify-between">
        <h2>标星问卷</h2>
        <div>
          <Input type="text" placeholder="请输入问卷名称" />
        </div>
      </div>
      <div>
        {tableList.map(item => <QuesaItem key={item._id} question={item} />)}
      </div>
    </div>
  )
}

export default PageEntry;